﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NuMvvm.Validation;
using NUnit.Framework;

namespace NuMvvm.Tests
{
    public class Person : ObservableObject
    {
        private string _name;
        private string _email;

        public string Name
        {
            get
            {
                return _name;
            }

            set
            {
                _name = value;
                OnPropertyChanged();
            }
        }

        [NotEmpty]
        [RegularExpression(RegularExpressions.Email, ErrorMessage = "Invalid email address.", AllowNullOrEmpty = true)]
        public string Email
        {
            get
            {
                return _email;
            }

            set
            {
                _email = value;
                OnPropertyChanged();
            }
        }
    }

    [TestFixture]
    public class ObservableObjectTest
    {
        [TestCase]
        public void TestCase1()
        {
            Person person = new Person();
            person.Name = "Robert Sundström";
            person.Email = "robert.sundstrom@outlook.com";
        }
    }
}
